%d | gives an integer |
%o | gives an octal integer |
%x | gives a hexadecimal integer |
%D | gives an integer that is either octal (leading zero), hexadecimal (leading 0x) or decimal. |
%f | gives a float |
%c | matches one char and returns it as an integer |
%2c | matches two chars and returns them as an integer (short) |
%s | gives a string |
%5s | gives a string of 5 characters (5 can be any number) |
%[set] | matches a string containing a given set of characters. (thos given inside the brackets) %[^set] means any character ecept those inside brackets. %[0-9H] means any number or 'H'. |
If a * is put between the percent and the operator, the operator will not only match it's argument, not assign any variables.
Number of matched arguments is returned.